Documentation > CMS Template API Library > Asset > GetFolderList(SortOrder,Nullable[Int32],List[String],List[String],List[String],List[String],Boolean)
GetFolderList
Gets a list of subfolders in this folder. All parameters are optional.
public List<Asset> GetFolderList(SortOrder,Nullable[Int32],List[String],List[String],List[String],List[String],Boolean)
Returns
Optional:The list of subfolders.
Parameters
| Name | Description | Type |
|---|---|---|
| sortOrder | Optional: The sort order. Defaults to null. | CrownPeak.CMSAPI.SortOrder |
| limit | Optional: The maximum number of assets to return. Defaults to null. | Nullable<Int32> |
| fieldNames | Optional: The names of fields that will be preloaded into the returned assets. Defaults to null. | List<String> |
| excludes | Optional: Labels of the assets to be excluded from the returned list. Defaults to null. | List<String> |
| filterStatus | Optional: The workflow statuses to filter on. Defaults to null. | List<String> |
| excludeFilterStatus | Optional: The workflow statuses to exclude. filterStatus will be ignored if this is set. Defaults to null. | List<String> |
| excludeProjectTypes | Optional: Set to false if you want project related types like libraries templates, etc to be returned. Defaults to true. | System.Boolean |
Code Example
C#
Sample:
// Get the folders from an asset, but no more than 10, note how we pass an optional arg. Order doesn't matter
// if you use named parameters
List<Asset> folders = asset.GetFolderList(limit: 10);
// Load up to 10 assets and preload the fields foo and bar into each asset's field cache, if they exist
List<Asset> folders = asset.GetFolderList(limit: 10, fieldNames: Util.MakeList("foo","bar");
// Don't load any children named "Configuration"
List<Asset> folders = asset.GetFolderList(excludes: Util.MakeList("Configuration");
// Load folders with workflow that are in the "Stage" state.
List<Asset> folders = asset.GetFolderList(filterStatus: Util.MakeList("Stage"));